package Entity;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;

import VOs.MarketVO;

@Entity
public class Market {

	/**
	 * @uml.property name="id" readOnly="true"
	 */
	@Id
	private int id;
	/**
	 * @uml.property name="name"
	 */
	@Column(name = "\"NAME\"")
	private String name;
	/**
	 * @uml.property name="nemo"
	 */
	private String nemo;
	/**
	 * @uml.property name="description"
	 */
	private String description;
	@OneToMany(mappedBy = "market")
	private List<Company> companies;
	
	public MarketVO tovo(){
		MarketVO vo = new MarketVO();
		vo.setDescription(getDescription());
		vo.setId(getId());
		vo.setName(getName());
		vo.setNemo(getNemo());
		vo.setCompanies(getCompanies());
		
		return vo;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getNemo() {
		return nemo;
	}

	public void setNemo(String nemo) {
		this.nemo = nemo;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public List<Company> getCompanies() {
		return companies;
	}

	public void setCompanies(List<Company> companies) {
		this.companies = companies;
	}
}
